package com.xcity.game.skill.v2.impl;

import com.xcity.game.skill.v2.SkillEffector;
import com.xcity.game.skill.v2.DefaultSkillV2;
import com.xcity.game.combat.attr.CombatAttributeType;
import com.xcity.game.combat.attr.CombatAttributeFilter;

// !!! THIS IS A GENERATED CLASS. !!!
/**
 * 生命强化
 * @author yang.li
 *
 */
public class PASSIVE_SKILL_G_HP implements SkillEffector {

	private DefaultSkillV2 refer;

	public PASSIVE_SKILL_G_HP(DefaultSkillV2 refer) {
		this.refer = refer;
	}

	@Override
	public float enhance(CombatAttributeType type, float value) {
		
		if (type == CombatAttributeType.HP || type == CombatAttributeType.MAX_HP) {
			float factor = refer.getParams()[0];
			return CombatAttributeFilter.Filters.ADD_PERCENT.doFilter(value, factor);
		}
		
		return 0f;
	}
	
	@Override
	public CombatAttributeType[] getEnhanceTypes() {
		return new CombatAttributeType[] { CombatAttributeType.HP };
	}

}
